\section{DATA ACQUISITION} \label{sec:data_aq}

The data acquisition was performed using LabView in both operation modes. When in manual mode, Labview opened and configured the serial port and then continuously read the data sent by the microcontroller. The data came in a string format, which was read until a termination character was recognized, when a new cycle was initiated. At each cycle, Labview splited the string and converted the parameters values to number format. Each new parameter value was plotted in a graph format or shown on LabView's Front Panel. When the loop was finished, the data was saved into a text file for later analysis and the serial port was closed.

Using manual control, the operator can perform step-like inputs in the servo motor, but due to the nature of the control stick perfect steps not possible. To overcome this, the command signals to the servo were generated in LabView. 

When in automatic control, Labview opened and configured the serial port. Two loops were initiated simultaneously and ran in parallel. One loop read data continuously, just like in the manual mode. This loop ran always at $50 Hz$, which was the sampling rate sent by the microcontroller. The second loop generated the command signal for the servo. This loop could run at different rates, depending on the type of command signal desired. However, the maximum rate acceptable was $50 Hz$. Since the microcontroller read always at $50 Hz$, any data sent at a rate faster than $50 Hz$ would have some fraction of loss. Since standart RC hobby servos operate at $50Hz$ this did not present any serious limitation.

\section{SIGNAL GENERATION}

The LabView VI was designed to allow sending different types of signal to the MCU and switching between them without aborting the execution. Also, the operator could change the command signal parameters, such as frequency and amplitude, without stopping the acquisition.

On a build-up approach, the first signal sent was a constant value, the value of which was manually input by the computer operator from minimum to maximum servo range. Using this type of input signal, it was possible to acquire a steady-state value of RPM and thrust parameters from the engine for each servo input value, from idle to maximum thrust.

After that, a square wave signal with amplitude varying  between the minimum and maximum values was sent to the MCU. The square wave frequency could be changed at any time. With this type of input signal, it was possible to collect output signals from rotation and thrust and estimate a transfer function for the whole system (servo + engine), using the LabView System Identification Toolbox.

Another way to obtain the transfer function was applying sinusoidal frequency sweep to the servo motor. Again, on a build up approach, only a sine wave signal was initially created. The engine response was tested since very low frequencies ($0.03125 Hz$, i.e. one cycle at each $32 s$) until $4 Hz$, slighty above the system's cutoff frequency. From this test, some points from the sytem's Bode diagram could be drawn, where each point would correspond to one frequency tested. However, since no objectionable behavior was observed, a sinusoidal frequency sweep signal was implemented. A new batch of data signals was obtained to be compared with the results obtained from the square wave signal.